<template>
  <el-row>
      <el-col :span="24">
          <el-card>
              <el-form :inline="true" class="demo-form-inline">
              </el-form>
              <el-scrollbar height="530px">
                  <el-table :data="tasklist" border style="width: 100%">
                      <el-table-column prop="tid" label="ID" width="45px" />
                      <el-table-column prop="rstart" label="报修时间" />
                      <el-table-column prop="location" label="报修任务地址" width="200px" />
                      <el-table-column prop="tname" label="报修描述" width="150px" />
                      <el-table-column prop="rend" label="完成时间" />
                  </el-table>
              </el-scrollbar>
          </el-card>
      </el-col>
  </el-row>


</template>

<script setup>
import { ref } from 'vue';
import repairerApi from '@/api/repairerApi';
const rid = ref();
//保存维修任务信息的数组
const tasklist = ref([])
//定义方法获取id
function getid() {
  repairerApi.selectInfoByRid()
    .then(resp => {
      rid.value = resp.data.rid;
      selectAll();
    });

}
getid();

//定义方法获取所有任务信息
function selectAll() {
  repairerApi.selectTaskByRid(rid.value)
    .then(resp => {
      tasklist.value = resp.data;
    });
}
</script>
<style scoped></style>